package com.xcl.dao.imp;

import java.awt.List;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.LinkedList;

public class logDao {
	 
	static{
		try {
			Class.forName("com.mysql.jdbc.Driver");
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		}
	}
	public static int findone(String num,String pass) {
		int result=0;
		try {
			Connection conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/xiaocilang", "root","123456");
			PreparedStatement pst=conn.prepareStatement("select * FROM admin where admin_id=?");
			pst.setString(1,num);
			ResultSet rs=pst.executeQuery();
			while (rs.next()) {
				String s=rs.getString(2);
				if (!s.equals(pass)||s.equals(null)) {
					result=0;
				}else {
					result=1;
				}
			}
		} catch (Exception e) {
			// TODO: handle exception
		}
		return  result;
		
		
		
	}
}
